<!DOCTYPE html>
<html>
<head>
  <meta charset="utf-8">
  <title>Basic Test Suite</title>
  <!-- Load local QUnit. -->
  <link rel="stylesheet" href="../node_modules/grunt-contrib-qunit/test/libs/qunit.css" media="screen">
  <script src="../node_modules/grunt-contrib-qunit/test/libs/qunit.js"></script>
  <!-- Load local lib and tests. -->
  <script src="../dist/mock.js"></script>
  <script src="../node_modules/handlebars/dist/handlebars.js"></script>
</head>
<body>
  <script type="text/javascript">
    var tpl = Mock.heredoc(function() {
      /*
<div bx-tmpl="list" bx-datakey="list">
  <table class="table" bx-name="tables" bx-path="brix/gallery/tables/" id="tables">
    <thead>
      <tr>
        <th></th>
        <th>访问来源</th>
        <th width="200px">UV占比</th>
        <th>UV</th>
        <th>PV</th>
        <th>人均页面访问数</th>
        <th>宝贝收藏数</th>
        <th>收藏率</th>
        <th>成交金额</th>
        <th>转化率</th>
        <th>操作</th>
      </tr>
    </thead>
    <tbody>
      {{#each list}}
      <tr class="tr-parent bold">
        <td><i mx-click="toggle" class="J_expendCollapse icon-expend"></i></td>
        <td>{{id}} {{分组}}</td>
        <td>
          <span class="process-parent" style="width: {{UV占比}}px;"></span>
          {{UV占比}}%
        </td>
        <td>{{UV}}</td>
        <td>{{PV}}</td>
        <td>{{人均页面访问数}}</td>
        <td>{{宝贝收藏数}}</td>
        <td>{{收藏率}}</td>
        <td>{{成交金额}}</td>
        <td>{{转化率}}</td>
        <td>
        </td>
      </tr>
      {{#each children}}
      <tr class="tr-child">
        <td></td>
        <td>{{渠道}}</td>
        <td>
          <span class="process-child" style="width: {{UV占比}}px;"></span>
          {{UV占比}}%
        </td>
        <td>{{UV}}</td>
        <td>{{PV}}</td>
        <td>{{人均页面访问数}}</td>
        <td>{{宝贝收藏数}}</td>
        <td>{{收藏率}}</td>
        <td>{{成交金额}}</td>
        <td>{{转化率}}</td>
        <td>
          <div class="operation">
            <a href="javascript:" mx-click="perspective{ srcIdLevel1:{{srcIdLevel1}},srcIdLevel2:{{srcIdLevel2}},channel:{{渠道}},vs:{{vs}} }" class="mr10">透视分析</a>
          </div>
        </td>
      </tr>
      {{/each}}
      {{/each}}
    </tbody>
  </table>
</div>
<!-- Mock {
    'id|+1': 1,
    'list|1-5': [],
    'children|1-5': [],
    '分组|1': '@AREA',
    '渠道|1': '@REGION',
    'percent|1-100': 1,
    'UV占比|1-100': 1,
    'UV|1-100000000': 1,
    'PV|1-100000000': 1,
    '人均页面访问数|1-100000000': 1,
    '宝贝收藏数|1-100000000': 1,
    '收藏率': '@percent%',
    '成交金额|1-100000000.2': 1.0,
    '转化率': '@INTEGER(1,100)%',
    'srcIdLevel1|1-10': 1,
    'srcIdLevel2|1-10': 1,
    'vs': '@渠道'
}
-->
    */
    })
    test('mock4tpl', function() {
      var data = Mock.tpl(tpl);
      ok(data.list.length)
    })
  </script>
  
  <div id="qunit"></div>
  <div id="qunit-fixture"></div
</body>
</html>
